<?php

function mysqlexecuta($id, $sql, $erro = 1)
{
    if (empty($sql) OR !($id))
        return 0;

    mysql_query("SET NAMES 'utf8'");
    mysql_query('SET character_set_connection=utf8');
    mysql_query('SET character_set_client=utf8');
    mysql_query('SET character_set_results=utf8');

    if (!($res = @mysql_query($sql, $id)))
    {
        if ($erro)
            echo "Erro.";
        exit;
    }


    return $res;
}

?>